package com.weu.mapper;

import com.weu.bean.Car;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SaleMapper {

    /**
     * 查询指定经销商下所出售的所有汽车
     *
     * @return
     */
    @Select("SELECT * FROM ilmc_car car WHERE car.car_id IN" +
            "(SELECT sale.sale_carid FROM ilmc_sale sale WHERE sale.sale_userid = #{id})")
    public List<Car> getByUid(int id);
}
